Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make calls on cacheArtifacts/reconnect/submit/canel non-blocking #556

Merged
merged 3 commits into from
Sep 14, 2023

Conversation

Andyz26
Copy link
Collaborator

@Andyz26 Andyz26 commented Sep 14, 2023

Context

Convert the get resourceGateway calls (which perform RPC connection inside) to return future and perform the actions on the future's completion instead of blocking and waiting.

Checklist

  • ./gradlew build compiles code correctly
  • Added new tests where applicable
  • ./gradlew test passes all tests
  • Extended README or added javadocs where applicable

@github-actions
Copy link

github-actions bot commented Sep 14, 2023

Test Results

543 tests  +97   535 ✔️ +97   7m 41s ⏱️ + 2m 59s
128 suites +37       8 💤 +  1 
128 files   +37       0  -   1 

Results for commit f5be7bc. ± Comparison against base commit adeca1f.

♻️ This comment has been updated with latest results.

@@ -259,6 +259,13 @@ protected TaskExecutorGateway getGateway() throws ExecutionException, Interrupte
return this.gateway.get();
}

protected CompletableFuture<TaskExecutorGateway> getGatewayAsync() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can this be async?

Copy link
Contributor

@sundargates sundargates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Do get rid of the blocking method, as it could lead to potential bad usage in the future.

@@ -118,7 +118,7 @@ CompletableFuture<TaskExecutorID> getTaskExecutorFor(
*/
CompletableFuture<TaskExecutorGateway> getTaskExecutorGateway(TaskExecutorID taskExecutorID);

CompletableFuture<TaskExecutorGateway> reconnectTaskExecutorGateway(TaskExecutorID taskExecutorID);
CompletableFuture<Ack> reconnectTaskExecutorGateway(TaskExecutorID taskExecutorID);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: s/reconnect.*Gateway/reconnect

@@ -259,6 +259,13 @@ protected TaskExecutorGateway getGateway() throws ExecutionException, Interrupte
return this.gateway.get();
}

protected CompletableFuture<TaskExecutorGateway> getGatewayAsync() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no need to explicitly call this method async since the type already reflects that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, get rid of the blocking method.

@Andyz26 Andyz26 had a problem deploying to Integrate Pull Request September 14, 2023 18:40 — with GitHub Actions Failure
@Andyz26 Andyz26 had a problem deploying to Integrate Pull Request September 14, 2023 18:42 — with GitHub Actions Failure
@Andyz26 Andyz26 merged commit 3ebcf81 into master Sep 14, 2023
2 of 3 checks passed
@Andyz26 Andyz26 deleted the andyz/refactorGWBlock branch September 14, 2023 21:04
@Andyz26 Andyz26 changed the title Make calls on cacheArtifacts/reconnect non-blocking Make calls on cacheArtifacts/reconnect/submit/canel non-blocking Sep 14, 2023
@@ -112,6 +115,8 @@ public Receive createReceive() {
.match(FailedToSubmitScheduleRequestEvent.class, this::onFailedToSubmitScheduleRequestEvent)
.match(RetryCancelRequestEvent.class, this::onRetryCancelRequestEvent)
.match(Noop.class, this::onNoop)
.match(Ack.class, ack -> log.debug("Received ack from {}", sender()))
.match(Failure.class, failure -> log.error("Received failure from {}: {}", sender(), failure))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is this message sent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants